package com.example.idachuappone.index.welcomentity;

import java.util.ArrayList;
import java.util.List;

import org.json.JSONArray;
import org.json.JSONObject;

public class Version {
	private String android;
	private List<String> content;
	private String min;
	private String version;

	public void parseJson(JSONObject json) {
		if (json != null) {
			if (json.has("version")) {
				this.version = json.optString("version");
			}
			if (json.has("min")) {
				this.min = json.optString("min");
			}
			if (json.has("upgrade")) {
				List<String> temp = new ArrayList();
				JSONArray jsonArray = json.optJSONObject("upgrade").optJSONArray("Android");
				for (int i = 0; i < jsonArray.length(); i++) {
					temp.add(jsonArray.optString(i));
				}
				this.content = temp;
			}
			if (json.has("download")) {
				this.android = json.optJSONObject("download").optString("Android");
			}
		}
	}

	public String getVersion() {
		return this.version;
	}

	public void setVersion(String version) {
		this.version = version;
	}

	public String getMin() {
		return this.min;
	}

	public void setMin(String min) {
		this.min = min;
	}

	public String getAndroid() {
		return this.android;
	}

	public void setAndroid(String android) {
		this.android = android;
	}

	public List<String> getContent() {
		return this.content;
	}

	public void setContent(List<String> content) {
		this.content = content;
	}
}
